package ru.spb.nicetu.schoolproject;

import ru.spb.nicetu.schoolproject.data.HibernateTblModel;
import ru.spb.nicetu.schoolproject.data.Performance;

/**
 * Created by dchernyshov on 25.04.15.
 */
public class TblModelForPerformance extends HibernateTblModel<Performance> {
    public TblModelForPerformance() {
        super(Performance.class, 1);
    }

    @Override
    public String getColumnName(int columnIndex) {
        switch (columnIndex) {
            case 0:
                return "Кол-во 5";
            case 1:
                return "Кол-во 4";
            case 2:
                return "Кол-во 3";
            case 3:
                return "Кол-во 2";
            default: return "";
        }
    }

    @Override
    public int getColumnCount() {
        return 4;
    }

    @Override
    public Object getValueAt(int i, int i1) {
        Performance performance = list.get(i);
        switch (i1) {
            case 0:
                return performance.getA();
            case 1:
                return performance.getB();
            case 2:
                return performance.getC();
            case 3:
                return performance.getD();
            default:
                return null;
        }
    }
}
